Skip to content

release: v10.12.0 — JP3D batched bridge extension to partial-res + ROI#448

Merged
SureshKViswanathan merged 1 commit into
mainfrom
v10.12.0-release-candidate
May 24, 2026
Merged

release: v10.12.0 — JP3D batched bridge extension to partial-res + ROI#448
SureshKViswanathan merged 1 commit into
mainfrom
v10.12.0-release-candidate

Conversation

@SureshKViswanathan

Copy link
Copy Markdown
Contributor

Summary

  • JP3D batched bridge extensionJP3DDecoder(cfg).decode with cfg.resolutionLevel > 0 and JP3DROIDecoder().decode(data, region:) now both run ONE batched iDWT dispatch instead of N per-slice dispatches.
  • JP3D wins (M2 release, in-process, 7 runs / 2 warmups, median): ct_3d_large 16M-voxel CT full −82.89 ms (1.13×) / res1 −25.82 ms (1.12×) / ROIq −47.53 ms (1.33×); ct_3d_mid full −38.85 / res1 −10.44 / ROIq −21.18.
  • Decoder-only, codestream byte-identical to v10.11.0. Closes v10.11.0's known-limitation "Partial-resolution + ROI paths not yet batched".

Correctness gate (release mode)

Suite Tests Result
V10_21_BatchedBridgeOptionsParityTests 7/7 PASS
V10_20_BatchedBridgeParityTests 5/5 PASS
V10_20_BatchedInverseInt32ParityTests 12/12 PASS
V10_20_JP3DBridgeParityTests 5/5 PASS
swift test --filter JP3D regression 519/519 PASS
J2KMedicalCorpusEncodePerformanceTests 2/2 PASS
J2KMedicalCorpusPerformanceTests 2/2 PASS
J2KStrictCrossCodecValidationTests 3/3 PASS

Test plan

  • Mandatory pre-release gate (encode-perf + decode-perf + cross-codec parity)
  • V10_21 options-bridge parity (K=0/2/4/N, ROI 128² and 64², K+ROI composition)
  • V10_20 architecture parity preserved (no regression on full-volume path)
  • JP3D regression sweep (519 tests including v10.10.0 partial-res + ROI + Z-narrow + round-trip)
  • JP3D A/B bench measurement (full + res1 + ROIq lanes, batched vs serial)
  • Codestream byte-equality vs v10.11.0 (no encoder change)

Companion documents

🤖 Generated with Claude Code

Closes the v10.11.0 known limitation. The batched bridge SPI now
handles K>0 partial-resolution and ROI cases inside
JP3DSliceStackCodec via a new JP3DBridgeOptions overload — the
v10.11.0 architecture extends naturally with a single options
struct that rides through the bundle.

JP3D full-decode + partial-res + ROI wins (M2 release, --jp3d
bench, in-process, 7 runs / 2 warmups, median):

  Fixture          vx        full Δ ms    res1 Δ ms    ROIq Δ ms
  --------------------------------------------------------------
  mr_3d_small      262K      −0.05        +1.86        −0.02
  ct_3d_small      1.05M     **−4.19**    −0.32        −2.19
  us_3d_small      1.84M     **−4.69**    +1.25        −2.73
  mr_3d_mid        2.10M     **−9.35**    −1.63        **−4.22**
  ct_3d_mid        8.39M     **−38.85**   **−10.44**   **−21.18**
  ct_3d_large      16.78M    **−82.89**   **−25.82**   **−47.53**

Per acceptance discipline (≥3 ms wins): full 4/6, res1 2/6,
ROIq 3/6 fixtures clear. Smaller fixtures wash on the lighter
lanes (reduced workload leaves less to amortise). Both 8M+ CT
volumes (radiologist scrolling case) win on every lane.

Architectural surface — new opaque options:
  • JP3DBridgeOptions(partialResolutionLevel:, regionOfInterest:)
  • J2KDecoder._jp3dDecodeToCoefficients(_:Data, options:JP3DBridgeOptions)

Pipeline:
  • DecoderPipeline.decodeToCoefficients(_:Data, options:) sets
    partialResolutionLevel + regionOfInterest before extractTileData,
    captures options into the returned bundle.
  • iDWTAndFinalizeCoefficients honours captured options:
    partial-res → sets outputDimensions for reconstructImage;
    ROI → post-iDWT crop via Self.cropImage.
  • iDWTAndFinalizeCoefficientsBatched eligibility gate now accepts
    uniform partial-res K + ROI across the batch. Orchestrator
    truncates the chain to effectiveLevels = N − K for partial-res;
    runs full chain for ROI then per-slice crops. K=0 thumbnail
    falls back to per-slice serial (no iDWT chain to dispatch).

JP3DSliceStackCodec wiring:
  • Removes the (K>0 || ROI) → per-slice-serial fallback in the
    bulk batched path. Both branches now build a JP3DBridgeOptions,
    decode all slices to coefficients in parallel via the new
    overload, then run ONE batched iDWT + finalize.
  • The (K>0 AND ROI) compositional throw still fires (2D codec
    doesn't compose those — separate arc).
  • Env-var off-switch J2K_JP3D_BATCHED_BRIDGE=0 still works.

Validation:
  - V10_21_BatchedBridgeOptionsParityTests   7/7  PASS
    (K=0/2/4/N, ROI 128² and 64², K+ROI composition)
  - V10_20_BatchedBridgeParityTests          5/5  PASS
  - V10_20_BatchedInverseInt32ParityTests   12/12 PASS
  - V10_20_JP3DBridgeParityTests             5/5  PASS
  - `swift test --filter JP3D` regression  519/519 PASS
  - Mandatory commit gate (release mode)     7/7  PASS

Codestream bytes byte-identical to v10.11.0; encoder unchanged.
MINOR per RELEASING.md — additive public surface, no removals,
no default flip that affects bytes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@SureshKViswanathan SureshKViswanathan merged commit 7a30f76 into main May 24, 2026
13 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant